<!-- Dom模板 -->
<template>
  <div>
    <!-- Dom内容 -->
    <HeadTab :tab='tab' @tabIndex="tabIndex"></HeadTab>
    <div class="drinkmanage" >
      <div class="drinkmanage_classify" v-if="tab[i].name === '商品类别'">
        <div class="drinkmanage_classify_head">
          <p>查询到20条</p>
          <div class="drinkmanage_classify_head_add"><span class="iconfont icon-tianjia"></span><p>添加分类</p></div>
        </div>
        <div v-for="(item,index) in 3" :key="index" class="drinkmanage_classify_content">

        </div>
      </div>
    </div>
    <router-view/>
  </div>
</template>

<script>
// import a from './a'; // 引入组件
import * as API from '../../api/drinkmanage'
import HeadTab from '../../components/headerTab/headerTab.vue'
export default {
  components:{
    HeadTab
  },
  name: '',
  data() {
    return {
      msg: '测试',
      tab:[
        {
          'name':"商品类别",
          "id":'0'
        },
        {
          'name':"商品资料",
          "id":'1'
        },
        {
          'name':"库存管理",
          "id":'2'
        },
        {
          'name':"需补货统计",
          "id":'3'
        }
      ],
      i:'0',
      classifyList:[],
      shopList:[],
    }
  },
  // 生命周期 - 创建完成（访问当前this实例）
  created() {},
  // 生命周期 - 挂载完成（访问DOM元素）
  mounted() {
      API.drinkmanageClassify().then((res)=>{
        console.log(res.data);
        this.classifyList = res.data
      })
      API.drinkmanageDataList().then((res)=>{
        console.log(res.data);
        this.shopList = res.data
      })
  },
  // Vue方法定义
  methods: {
      tabIndex(i){
        this.i = i
      }
  }
}
</script>

<style scoped>
/* @import url(''); 引入css类 */
.drinkmanage{
  width:99.9%;
  height: calc(100vh - 204px);
  background-color: rgb(208, 216, 189);
  border-right:1px solid #ccc;
}
.drinkmanage .drinkmanage_classify{
  width:90%;
  height: 94%;
  margin:0 auto;
  padding-top:2%;
}
.drinkmanage_classify_head{
  height: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.drinkmanage_classify_head_add{
  width:100px;
  height: 30px;
  border:1px solid blue;
  text-align: center;
  color:blue;
  font-size: 14px;
  display: flex;
  justify-content: space-evenly;
}
.drinkmanage_classify_head_add span{
  display: inline-block;
  height: 30px;
  line-height: 30px;
  padding:0px 2px;
  font-size: 16px;
}
.drinkmanage_classify_head_add p{
  height: 30px;
  line-height: 30px;
  margin:0;
}
.drinkmanage_classify_content{
  width:100%;
  height: 90px;
  background-color: #fff;
  margin-top: 10px;

}
</style>
